package com.gite.nouette.admin.implementation.view;

import com.gite.nouette.admin.contract.controller.ICContainerModule;
import com.gite.nouette.admin.contract.view.IVContainerModule;
import com.gite.nouette.admin.contract.view.IVModule;
import com.smartgwt.client.widgets.layout.PortalLayout;
import com.smartgwt.client.widgets.layout.Portlet;

public class VContainerModuleImpl extends PortalLayout implements
		IVContainerModule {

	private ICContainerModule c;

	public VContainerModuleImpl() {
		setNumColumns(0);
		setWidth100();
		setHeight100();
		setShowResizeBar(true);
	}

	@Override
	public String getName() {
		return getTitle();
	}

	@Override
	public void setName(String name) {
		setTitle(name);
	}

	@Override
	public ICContainerModule getC() {
		return this.c;
	}

	@Override
	public void setC(ICContainerModule controller) {
		this.c = controller;
	}

	@Override
	public boolean addModule(IVModule<?> vModule) {
		addPortlet((Portlet) vModule);
		return true;
	}

	@Override
	public boolean addModule(IVModule<?> vModule, int colNum, int rowNum) {
		addPortlet((Portlet) vModule, colNum, rowNum);
		return true;
	}

	@Override
	public boolean addModule(IVModule<?> vModule, int colNum, int rowNum,
			int rowOffset) {
		addPortlet((Portlet) vModule, colNum, rowNum, rowOffset);
		return true;
	}

	@Override
	public boolean removeModule(IVModule<?> vModule) {
		removePortlet((Portlet) vModule);
		return true;
	}
}
